<style>
body {
	text-align:center;
	margin:0px;
}

#staff_booked_sist_content {
	position: absolute;
	z-index: auto;
	height: auto;
	width: 1000px;
	left:0px;
	top:80px;
}
#staff_booked_sist_menu {
	width:400px;
	padding-left:20px;
	height:auto;
	text-align:left;
}
#staff_booked_sist_top {
	width:900px;
	height:auto;
	margin-top:10px;
	padding-left:50px;
	font-family:"ＭＳ Ｐゴシック", "ＭＳ ゴシック", "ＭＳ Ｐ明朝", "ＭＳ 明朝", "MS UI Gothic";
	font-size:14px;
}
#staff_booked_sist_content #staff_booked_sist_top table {
	font-family: "ＭＳ Ｐゴシック", "ＭＳ ゴシック", "ＭＳ Ｐ明朝", "ＭＳ 明朝", "MS UI Gothic";
	font-size: 14px;
	text-align: center;
}
</style>
	<!--{include /service/service_head}-->
	<div id="staff_booked_sist_content">
	<div id="staff_booked_sist_menu">
		<ul>
			${datamanage_backend($oauthMap)}
		</ul>
	</div>
	
	<div id="staff_booked_sist_top">
	<form action="/service/dataManage.php" id="indexform" method="get">
		<div>
			<select name="shop_id" class="f-city">
				<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($shopList, 'id', 'shop_name'), $defaultShopId)}
			</select>
			<select id="staff_id" name="staff_id">
	           	<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($staffList, 'id', 'family_name', 'personal_name'), $staffId)}
	        </select>
			<input type="submit" name="" value="検索" />
		</div>
	</form>
	
	<table width="900" border="1" cellspacing="0" cellpadding="0">
	<tr>
		<td>スタッフ</td><td>計算開始時間</td><td>計算終了時間</td>
		<td>トータル出勤時間</td><td>トータル休憩時間</td><td>勤務時間</td>
		<td>時給</td><td>給料合計</td><td>賞用</td><td>交通費</td><td>立替金</td>
		<td>その他</td><td>罰金</td><td>合計</td><td>印刷</td>
	</tr>
	
	<!--{loop $salaryMonthList $index1 $one1}-->
    <tr>
    	<?php
			$tempStaff = Staff::getById($one1['staff_id'])
    		?>
    	<td>{$tempStaff['family_name']} {$tempStaff['personal_name']}</td>
    	<td>${date("Y-m-d", $one1['start_time'])}</td>
    	<td>${date("Y-m-d", $one1['end_time'])}</td>
    	<td>{$one1['tuukin_total_hour']}時 {$one1['tuukin_total_minute']}分</td>
    	<td>{$one1['rest_total_hour']}時 {$one1['rest_total_minute']}分</td>
    	<td>{$one1['work_total_hour']}時 {$one1['work_total_minute']}分</td>
    	<td>${number_format($one1['salary'])}</td>
    	<td>${number_format($one1['back1'])}</td>
    	<td>${number_format($one1['reword_money'])}</td>
    	<td>${number_format($one1['bus_money'])}</td>
    	<td>${number_format($one1['change_money'])}</td>
    	<td>${number_format($one1['other_money'])}</td>
    	<td>${number_format($one1['batu_money'])}</td>
    	<td>${number_format($one1['total_money'])}</td>
    	<td><a href="/service/dataManage.php?id={$one1['id']}" target="_blank">印刷</a></td>
    	<!--{if $userAuth[84] != null}-->
    	<td><a href="/service/dataManage.php?id={$one1['id']}&action=del&shop_id={$defaultShopId}&staff_id={$staffId}"
   			onclick="return confirm('本当に削除しますか？')"
			style="text-decoration: none;">削除</a></td>
		<!--{/if}-->
    </tr>
    <!--{/loop}-->
    <!--{if $userAuth[83] != null}--> 
	<tr><td><a href="/service/dataManageEdit.php">給料作成</a></td></tr>
    <!--{/if}-->
  	</table>
  	</div>
  	</div>
</body>
</html>
<script type="text/javascript"> 
	var tempCalendar = null;
	jQuery(function(){
		if( $("input[name='start_date']").length > 0 ){
			tempCalendar = new Calendar(new Date().getFullYear(), 2020, 2,'yyyy-MM-dd');
			document.onclick = function(){
				//alert( 'using   js   2 ');
				tempCalendar.hide();
			}
			$("input[name='start_date']").bind("click", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});
			$("input[name='start_date']").bind("focus", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});

			$("input[name='end_date']").bind("click", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});
			$("input[name='end_date']").bind("focus", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});
	
			$("#calendarPanel").bind("click", function(e){
				e.stopPropagation();
				e.preventDefault();
			});
		}
	});

	jQuery(function(){
		$("select[name='shop_id']").bind("change", function(){
			if( $(this).val() < 1 ){
				return ;
			}
			$.get("{$webRoot}/service/searchStaff.php", "shop_id=" + $(this).val(), function(data){
				
				var options = '<option value="0">選択してください</option>';
				if( data.error == 0 ){
					for(var index in data.data){
						if( !index ){
							continue;
						}
						options = options + '<option value="' + data.data[index].id + '">' + data.data[index].family_name + " " + data.data[index].personal_name + '</option>';
						
					}
				}
				$("#staff_id").html(options);
			}, "json");
			
		});
	});
</script> 
</html> 